package <%=beanInfo.package%>.dao;

import <%=beanInfo.package%>.entity.<%=beanInfo.classname%>;
import <%=beanInfo.package%>.SpringContextTestCase;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.util.Assert;

import java.util.Date;

/**
* Created with ruby.
* User:
* Date: <%=beanInfo.date%>

*/
@ContextConfiguration(locations = {"/applicationContext.xml"})
public class <%=beanInfo.classname%>DaoTest extends SpringContextTestCase {

@Autowired
private <%=beanInfo.classname%>Dao <%=beanInfo.alias%>Dao;

@Test
public void testGet(){
<%=beanInfo.classname%> <%=beanInfo.classname%> = <%=beanInfo.alias%>Dao.get(6l);
Assert.notNull(<%=beanInfo.classname%>);
}

@Test
public void testSave(){
<%=beanInfo.classname%> <%=beanInfo.alias%> = new <%=beanInfo.classname%>();
//undo some properties set
<%=beanInfo.alias%>Dao.save(<%=beanInfo.alias%>);
}

@Test
public void testUpdate(){
<%=beanInfo.classname%> <%=beanInfo.alias%> = new <%=beanInfo.classname%>();
//undo some properties set
<%=beanInfo.alias%>Dao.update(<%=beanInfo.alias%>);
}

@Test
public void testDeleteById(){
<%=beanInfo.alias%>Dao.deleteById(1l);
}
}
